package com.example.pattern.db

import androidx.lifecycle.LiveData
import android.view.PointerIcon
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update


@Dao
interface PictureDao {
    //插入
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    suspend fun insertPicture(picture: Picture)
    //全部删除
    @Delete
    suspend fun deleteAll(picture: List<Picture>)
    //删除单个
    @Delete
    suspend fun deletePicture(picture:Picture)
    //修改数据
    @Update
    suspend fun updatePicture(picture: Picture)
    //取出数据
    @Query("select * from picture_table")
    fun queryPic():LiveData<List<Picture>>
}